<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>02_父组件与子组件</title>
</head>
<body>
    <div id="app">
        <father-cpn></father-cpn>
    </div>
</body>
<script src="../vue.js"></script>
<script>
    //1.首先定义一个子组件
    const sonCpn = Vue.extend({
        template: `<h3>我是子组件...</h3>`
    })

    //2. 再定义一个父组件,将子组件放进去
   const fatherCpn = Vue.extend({
        template: '<div><h2>我是父组件...</h2><son-cpn></son-cpn></div>',
        components: {
            sonCpn
        }
    })

    new Vue({
        el: '#app',
        components: {
            fatherCpn
        }
    })
</script>
</html>